package com.alt.shared;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

public class ALTSharedMgr
{
	private static final String PREFS_NAME = "ALTPayPrefs";
	
	private static SharedPreferences m_SharedData;
	
	public void setContext(Context context) {
		m_SharedData = context.getSharedPreferences(PREFS_NAME, Activity.MODE_PRIVATE);
	}
	
	public String getString(String Key, String DefValue) {
		return m_SharedData.getString(Key, DefValue);
	}
	
	public int getInt(String Key, int DefValue) {
		return m_SharedData.getInt(Key, DefValue);
	}
	
	public boolean getBoolean(String Key, boolean DefValue) {
		return m_SharedData.getBoolean(Key, DefValue);
	}
	
	public void setString(String Key, String Value) {
		SharedPreferences.Editor prefs = m_SharedData.edit();
		prefs.putString(Key, Value);
		prefs.commit();
	}
	
	public void remove(String Key) {
		SharedPreferences.Editor prefs = m_SharedData.edit();
		prefs.remove(Key);
		prefs.commit();
	}
	
	public void setInt(String Key, int Value) {
		SharedPreferences.Editor prefs = m_SharedData.edit();
		prefs.putInt(Key, Value);
		prefs.commit();
	}
	
	public void setBoolean(String Key, boolean Value) {
		SharedPreferences.Editor prefs = m_SharedData.edit();
		prefs.putBoolean(Key, Value);
		prefs.commit();
	}
}
